package cn.lyq.card.ui.income

import cn.lyq.card.R
import cn.lyq.card.data.model.IncomeInfo
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder


class IncomeAdapter : BaseQuickAdapter<IncomeInfo, BaseViewHolder>(
    R.layout.item_income, mutableListOf()
), LoadMoreModule {

    override fun convert(holder: BaseViewHolder, item: IncomeInfo) {
        holder.setText(R.id.tvValue, item.price)
            .setText(R.id.tvTime, item.addTime)
            .setText(R.id.tvSn, item.posSn ?: "")
            .setText(R.id.tvRemark, item.msg ?: "")

            .setGone(R.id.tvSn, item.posSn?.isNotEmpty() != true)
            .setGone(R.id.tvSnHint, item.posSn?.isNotEmpty() != true)
            .setGone(R.id.tvRemark, item.msg?.isNotEmpty() != true)
            .setGone(R.id.tvRemarkHint, item.msg?.isNotEmpty() != true)
    }
}